<template>
  <div>
    <h2>免费计算你的身体质量指数 (BMI)</h2>
    <div>
      <span>我的身高:</span>
      <input v-model="bmiForm.height">
    </div>
    <div>
      <span>我的体重:</span>
      <input v-model="bmiForm.weight">
    </div>
    <button @click="handleSubmit">计算BMI</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      bmiForm: {
        height: '',
        weight: ''
      }
    }
  },
  methods: {
    handleSubmit() {
      this.$emit('my-submit', this.bmiForm)
    }
  }
}
</script>
